package com.sskj.gocoinapp.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.gocoinapp.bean.SummaryBean;
import com.sskj.gocoinapp.http.HttpConfig;
import com.sskj.gocoinapp.ui.fragment.SummaryFragment;
import com.sskj.lib.http.JsonCallBack;


public class SummaryFragmentPresenter extends BasePresenter<SummaryFragment> {

    public void getSummary(String code) {
        httpService.getSummary(code)
                .execute(new JsonCallBack<HttpData<SummaryBean>>() {
                    @Override
                    public void onSuccess(Response<HttpData<SummaryBean>> response) {
                        HttpData<SummaryBean> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updateUI(httpData.getData());
                        }
                    }
                });
    }
}
